<?php use_helper('Date') ?>
<?php slot('title', __('Validate a request')) ?>

<form id="validateRequestForm" action="<?php echo url_for('requests/updateValidation?id=' . $form->getObject()->getId() . '&userId=' . $userId) ?>" method="post">
    <input type="hidden" name="sf_method" value="put" />
    <table>
        <tfoot>
            <tr>
                <td colspan="2">
                    <?php echo $form->renderHiddenFields(false) ?>
                    <input type="submit" value="<?php echo __('Accept') ?>" name="_accept" />
                    <input type="submit" value="<?php echo __('Refuse') ?>" name="_refuse" />
                </td>
            </tr>
        </tfoot>
        <tbody>
            <?php echo $form->renderGlobalErrors() ?>
            <tr>
                <th><?php echo $form['from']->renderLabel() ?></th>
                <td>
                    <?php echo format_date($form->getObject()->from) ?>
                </td>
            </tr>
            <tr>
                <th><?php echo $form['to']->renderLabel() ?></th>
                <td>
                    <?php echo format_date($form->getObject()->to) ?>
                </td>
            </tr>
            <tr>
                <th><?php echo $form['typeId']->renderLabel() ?></th>
                <td>
                    <?php echo $form->type ?>
                </td>
            </tr>
            <tr>
                <th><?php echo $form['askComment']->renderLabel() ?></th>
                <td>
                    <?php echo $form->getObject()->askComment ?>
                </td>
            </tr>
            <tr>
                <th><?php echo $form['answerComment']->renderLabel() ?></th>
                <td>
                    <?php echo $form['answerComment']->renderError() ?>
                    <?php echo $form['answerComment'] ?>
                </td>
            </tr>
        </tbody>
    </table>
</form>